// Author: wsfuyibing <682805@qq.com>
// Date: 2025-04-28

package kind

// Gender
// 性别.
type Gender int

const (
	GenderUnknown Gender = iota
	GenderMale
	GenderFemale
)

var (
	genderTexts = map[Gender]string{
		GenderUnknown: "保密",
		GenderMale:    "男",
		GenderFemale:  "女",
	}
	genderTextUndefined = "保密"
)

func GenderDict() []map[string]any {
	var res = make([]map[string]any, 0)
	for _, v := range []Gender{
		GenderUnknown,
		GenderMale,
		GenderFemale,
	} {
		res = append(res, map[string]any{
			"Key":   v,
			"Value": v.Text(),
		})
	}
	return res
}

func (o Gender) Text() string {
	if str, ok := genderTexts[o]; ok {
		return str
	}
	return genderTextUndefined
}
